package edu.uow.devdocs
/**
 * The CommentHistory entity.
 *
 * @author    
 *
 *
 */
class CommentHistory {
    static mapping = {
         table 'COMMENT_HISTORY'
         // version is set to false, because this isn't available by default for legacy databases
         version false
         id column:'COMMENT_HISTORY_ID'
		 project column:'SUB_SYSTEM_ID'
		 id generator: 'sequence', params:[sequence:'COMMENT_HISTORY_SEQ']
		 sort dateOfComment:'ASC'
    }
	
    String comment
    Project project
    Person person
    Date dateOfComment = new Date()
	Issue issue
	DevelopmentChecklist developmentChecklist
	DevelopmentTask developmentTask

    static constraints = {
        comment(size: 3..2000,nullable: false)
        project(nullable: true)
        person(nullable: false)
        dateOfComment(nullable: false)
		issue(nullable: true)
		developmentChecklist(nullable: true)
		developmentTask(nullable: true)
    }
    String toString() {
        return "${person} ${dateOfComment} ${comment}" 
    }
}
